feat(create): scaffold backend-and-client on the vite-plugin client convention - #580
Merged
Merged
Conversation
Contributor
🚀 Package Preview Available!Install this PR's preview build with npm: npm i @base44-preview/cli@0.1.8-pr.580.14c640aPrefer not to change any import paths? Install using npm alias so your code still imports npm i "base44@npm:@base44-preview/cli@0.1.8-pr.580.14c640a"Or add it to your {
"dependencies": {
"base44": "npm:@base44-preview/cli@0.1.8-pr.580.14c640a"
}
}
Preview published to npm registry — try new features instantly! |
|
Cryptoease |
This was referenced Jul 30, 2026
davidsu
added a commit
that referenced
this pull request
Jul 30, 2026
…44 build, deploy --build The full #580 feature set, rebuilt on top of the decoupled serveCommand runner (#582). dev --remote is now just: resolve the configured serveCommand (or fail), resolve the app's published URL (or fail), run the same runner local dev uses — no backend, no parallel implementation. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
davidsu
force-pushed
the
feat/dev-remote-vite-plugin-template
branch
from
July 30, 2026 13:01
2253db8 to
bee958d
Compare
davidsu
added a commit
that referenced
this pull request
Jul 30, 2026
…44 build, deploy --build The full #580 feature set, rebuilt on top of the decoupled serveCommand runner (#582). dev --remote is now just: resolve the configured serveCommand (or fail), resolve the app's published URL (or fail), run the same runner local dev uses — no backend, no parallel implementation. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
davidsu
force-pushed
the
feat/dev-remote-vite-plugin-template
branch
from
July 30, 2026 13:09
bee958d to
474fd00
Compare
davidsu
added a commit
that referenced
this pull request
Aug 3, 2026
…44 build, deploy --build The full #580 feature set, rebuilt on top of the decoupled serveCommand runner (#582). dev --remote is now just: resolve the configured serveCommand (or fail), resolve the app's published URL (or fail), run the same runner local dev uses — no backend, no parallel implementation. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
davidsu
force-pushed
the
feat/dev-remote-vite-plugin-template
branch
2 times, most recently
from
August 3, 2026 11:52
0b64316 to
2bd3942
Compare
davidsu
force-pushed
the
feat/dev-remote-vite-plugin-template
branch
from
August 3, 2026 12:23
2bd3942 to
dd0802f
Compare
davidsu
added a commit
that referenced
this pull request
Aug 3, 2026
…44 build, deploy --build The full #580 feature set, rebuilt on top of the decoupled serveCommand runner (#582). dev --remote is now just: resolve the configured serveCommand (or fail), resolve the app's published URL (or fail), run the same runner local dev uses — no backend, no parallel implementation. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
davidsu
force-pushed
the
feat/dev-remote-vite-plugin-template
branch
from
August 3, 2026 13:20
dd0802f to
e8ac198
Compare
…onvention The template adopts the same client wiring editor-created apps use: @base44/vite-plugin (supplies the @ alias and the /api dev proxy) + src/lib/app-params.js (the refactored env-only version from apper#18730, byte-identical) + a static base44Client.js on same-origin /api (serverUrl: ''). The app id leaves scaffolded source: it is injected at serve/build time via VITE_BASE44_APP_ID — by base44 dev, dev --remote, build, and deploy --build — instead of being baked in by create. The post-scaffold build in create/scaffold injects it too, and the missing-build-output hint now points at base44 build. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
davidsu
force-pushed
the
feat/dev-remote-vite-plugin-template
branch
from
August 4, 2026 11:50
c584d20 to
35ecce5
Compare
netanelgilad
reviewed
Aug 4, 2026
netanelgilad
reviewed
Aug 4, 2026
netanelgilad
reviewed
Aug 4, 2026
netanelgilad
previously approved these changes
Aug 4, 2026
Mirrors apper fbab06de98f (PR #18730) per Netanel's #580 review: the SDK already defaults requiresAuth to false, so the template stops passing it. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
davidsu
enabled auto-merge (squash)
August 6, 2026 09:25
guyofeck
self-requested a review
August 6, 2026 12:25
guyofeck
approved these changes
Aug 6, 2026
guyofeck
left a comment
Contributor
There was a problem hiding this comment.
Create a github issue for the app params left over and merge it 🔥
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Note
Description
The
backend-and-clientscaffold now uses the same client wiring that editor-created Base44 apps use, so both app species share one convention.vite.config.jsloads@base44/vite-plugin(which supplies the@alias and the/apidev proxy), the SDK client talks to a same-origin/api(serverUrl: ''), and the app id is no longer baked into scaffolded source — it arrives at run/build time throughVITE_BASE44_APP_ID. Scaffolded apps therefore get local entities and functions underbase44 dev, and work unchanged against the production backend underbase44 dev --remote.Related Issue
None. Related PRs: #586, #587, #588 — the other three slices of the original unified local-dev rescope, already merged; this PR is the remaining template-convergence slice. The
src/lib/app-params.jscopy tracks base44-dev/apper#18730.Type of Change
Changes Made
templates/backend-and-client/vite.config.js— replaced the manualresolve.aliasblock with thebase44()Vite plugin (base44()+react()); the plugin supplies the@alias and proxies/apito the local dev backend.templates/backend-and-client/src/lib/app-params.js(new) — readsappId,functionsVersion, andappBaseUrlfromimport.meta.env, delegates the token to the SDK'sgetAccessToken(), and honors?clear_access_token=trueby clearing the stored token. Verbatim copy of the upstream apper file.templates/backend-and-client/src/api/base44Client.js(new, static) —createClientfed fromappParams, on same-origin/api(serverUrl: '',requiresAuth: false).templates/backend-and-client/src/api/base44Client.js.ejs(deleted) — the app id is no longer templated into scaffolded source at create time.templates/backend-and-client/package.json— bumped@base44/sdkto^0.8.40(for thegetAccessTokenexport) and added@base44/vite-plugin^1.0.30.cli/commands/project/scaffold-shared.ts— the post-scaffold build now runs withVITE_BASE44_APP_IDset to the new project id, so the first build carries the app id even though it is no longer in source.core/site/deploy.ts— both missing/empty output-directory hints now point atbase44 build(which injects the app id) instead of a barenpm run build.CHANGELOG.md— added aChangedentry describing the new template convention.Testing
npm test)Added
create.spec.ts→ "scaffolds backend-and-client with the editor-app client convention", asserting the scaffolded client usesserverUrl: ''and@/lib/app-paramsand does not hardcode the app id, thatapp-params.jsreadsVITE_BASE44_APP_ID/VITE_BASE44_APP_BASE_URL, thatvite.config.jsreferences@base44/vite-plugin, and that the app id still lands inbase44/.app.jsonc.build,lint,typecheck, andknipare green on CI; the four test-matrix jobs (ubuntu/windows × npm/binary) were still pending when this description was generated, so the "all tests pass" box is left unchecked rather than claimed.Checklist
docs/(AGENTS.md) if I made architectural changesAdditional Notes
src/lib/app-params.jsis a verbatim copy of the upstream apper file and must not diverge from it; if that upstream PR changes in review, re-copy the file here.@base44/vite-pluginfor the@alias and the/apiproxy. Existing projects are untouched — only newly scaffolded apps lose the hardcoded-appIdclient.npm run buildin a scaffolded project produces a bundle without an app id;base44 build(orbase44 deploy --build) is the supported path, which is why the deploy hints were reworded.docs/update: this changes template contents and one env var passed to a build, not CLI architecture — theCHANGELOG.mdentry covers the user-visible behavior.🤖 Generated by Claude | 2026-08-04 11:52 UTC | 14c640a